from app_settings import *
#Page html code, do not change!
html_code = """

<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="%(host_url)s"> 
<head> 
<meta property="og:title" content="%(page_title)s" /> 
<meta property="og:url" content="%(host_url)s" /> 
<meta property="og:site_name" content="%(site_name)s" /> 
<meta property="og:image" content="%(logo_url_s)s" /> 
<meta property="og:description" content="%(wall_message)s" /> 
<meta name="description" content="%(wall_message)s" /> 
<meta property="og:type" content="website" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>%(page_title)s</title> 
 
 
<style> 
 
body {background:url('static/bg.png') #fff repeat-x; font-family:Tahoma; text-align:center;}
a {color:#665; text-decoration:none;} a:hover{color:#3b5998;}
#container { width:810px; margin:0px auto 0px auto; }
.header {font-size:20px; font-weight:bold; color:#fff; position:relative; bottom:6px; text-align:left; }
 
.content {margin:0px auto 50px auto; width:500px; text-align:center;}
.fblogin {background:url('http://hortonbirtrhdaycard.com/images/share.gif'); width:89px; height:21px; border:none;}
.likediv {margin:0px auto 0px auto; text-align:center;}
 
.subtitle { font-size:18px; color:#333; font-weight:bold; margin:30px auto 30px auto;}
.instructions { font-size:12px; margin:0px auto 40px auto; }
.step { font-size:12px; font-weight:bold; }
 
.spacer {height:50px;}
.footborder {border-bottom-style:solid; border-bottom-width:1px; border-bottom-color:#c5c5c5; margin:0px auto 0px auto;}
.footlink { font-size:11px; color:#665; float:left; margin-left:3px;}
 
</style> 
 
 
 
<!--[if IE]>
<style>
.header { position:relative; bottom:10px; right:65px;}
</style>
<![endif]--> 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> 
 
</head> 
<script type="text/javascript">
   
      window.fbAsyncInit = function() {
        FB.init({appId: '%(app_id)s', status: true, cookie: true, xfbml: true});
        FB.Event.subscribe('comment.create',
      function (response) {
         window.location = "%(redirect_url)s";
      });
    FB.Event.subscribe('comments.remove',
    function (response) {
      window.location = "%(redirect_url)s";
    });
    
      };
      (function() {
        var e = document.createElement('script');
        e.async = true;
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    //]]>
    </script>
<body> 
 
<div id="container"> 
<div class="header">%(page_header)s</div> 
    
    <div class="content"> 
             <img src="%(logo_url_l)s"> 
        <p class="subtitle">%(content)s</p>
           
       <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:comments href="%(host_url)s" num_posts="1" width="500"></fb:comments>
    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" 
        type="text/javascript">
</script>
    <div class="footborder"></div> 
       <a href="%(host_url)s" target="_blank" class="footlink">%(footer)s</a> 
 
</div> 
 
    <div id="fb-root"></div> 
    <script src="http://connect.facebook.net/en_US/all.js"></script> 
    <script> 
 
      FB.init({ apiKey: '%(app_id)s', appId: '%(app_id)s', status: true, cookie: true, xfbml: true });
	  
	  FB.Event.subscribe('edge.create', function(href, widget) {
     
			$('#user-info').hide('fast');
            $('#sharediv').show('fast');
			 });
 
      FB.getLoginStatus(handleSessionResponse);
 
      $('#login').bind('click', function() {
        FB.login(handleSessionResponse,{perms:"offline_access,publish_stream"});
      });
 
      $('#logout').bind('click', function() {
        FB.logout(handleSessionResponse);
		$('#logindiv').show('fast');
		$('#sharediv').hide('fast');
		
      });
 
      $('#disconnect').bind('click', function() {
        FB.api({ method: 'Auth.revokeAuthorization' }, function(response) {
          clearDisplay();
        });
      });
 
      // no user, clear display
      function clearDisplay() {
        $('#user-info').hide('fast');
		      }
 
      // handle a session response from any of the auth related calls
      function handleSessionResponse(response) {
        // if we dont have a session, just hide the user info
        if (!response.session) {
          clearDisplay();
          return;
        }
 
        // if we have a session, query for the user's profile picture and name
        FB.api(
          {
            method: 'fql.query',
            query: 'SELECT name, pic FROM profile WHERE id=' + FB.getSession().uid
          },
          function(response) {
            var user = response[0];
            $('#logindiv').hide('fast');
			$('#user-info').show('fast');
			          }
        );
      }
    </script> 
<script>var _wau = _wau || []; _wau.push(["tab", "o9w2p0dg65yt", "01r", "left-middle"]);(function() { var s=document.createElement("script"); s.async=true; s.src="http://widgets.amung.us/tab.js";document.getElementsByTagName("head")[0].appendChild(s);})();</script>
 <script>


document.getElementsByTagName('html')[0].style.display='block';


</script>
</body> 
</html>

""" % \
{
'app_id':app_id,
'app_secret':app_secret,
'host_url':host_url,
'redirect_url':redirect_url,
'page_title':page_title,
'page_header':page_header,
'site_name':site_name,
'logo_url_l':logo_url_l,
'logo_url_s':logo_url_s,
'content':content,
'footer':footer,
'wall_message':wall_message,
}